<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>es6继承</title>
</head>
<body>
  <script>
    class Father{
      constructor(name,age){
        this.name=name;
        this.age=age;
      }
      showAge(){
        return this.age;
      }
    }
    class Son extends Father{
      constructor(name,age,grade){
        super(name,age);
        this.grade=grade;
      }
      showInfo(){
        console.log(this.name+";"+super.showAge()+";"+this.grade)
      }
    }
    var son=new Son("zzc",12,"四年级");
    son.showInfo();
  </script>
</body>
</html>